package com.qsl.ssyx.activity.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qsl.ssyx.model.activity.CouponRange;
import com.qsl.ssyx.activity.mapper.CouponRangeMapper;
import com.qsl.ssyx.activity.service.CouponRangeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.lang.invoke.LambdaConversionException;
import java.util.List;

/**
 * <p>
 * 优惠券范围表 服务实现类
 * </p>
 *
 * @author 青衫泪
 * @since 2023-08-28
 */
@Service
public class CouponRangeServiceImpl extends ServiceImpl<CouponRangeMapper, CouponRange> implements CouponRangeService {

    //根据couponId查询优惠卷范围
    @Override
    public List<CouponRange> getCouponRangeByCouponId(Long couponId) {
        LambdaQueryWrapper<CouponRange> lqw = new LambdaQueryWrapper<>();
        lqw.eq(CouponRange::getCouponId, couponId);
        List<CouponRange> couponRangeList = baseMapper.selectList(lqw);
        return couponRangeList;
    }
}
